class SendingBufferProfile {
    static const double LOW_THRESHOLD_MIN = 0.0;
    static const double LOW_THRESHOLD_MAX = 1.0;
    static const double LOW_THRESHOLD_DEFAULT = 0.2;
    static const double HIGH_THRESHOLD_MIN = 0.0;
    static const double HIGH_THRESHOLD_MAX = 1.0;
    static const double HIGH_THRESHOLD_DEFAULT = 0.8;
    static const double DURATION_LIMIT_MIN = 1.1;
    static const double DURATION_LIMIT_MAX = 5.0;
    static const double DURATION_LIMIT_DEFAULT = 3.0;
    static const int LOW_THRESHOLD_TIMEOUT_MIN = 10000;
    static const int DEFAULT_LOW_THRESHOLD_TIMEOUT = 60000;
    double mLowThreshold;
    double mHighThreshold;
    double mDurationLimit;
    int mLowThresholdTimeout;

    SendingBufferProfile(double var1, double var2, double var3, int var4) {
      double var6;
      double var8;
      if (var1 >= 0.0 && var1 <= 1.0 && (var6 = var1) < (var8 = var2) - 0.1) {
        if (var2 >= 0.0 && var2 <= 1.0 && var8 > var6 + 0.1) {
          if (var3 >= 1.1 && var3 <= 5.0) {
            if (var4 >= 10000) {
              this.mLowThreshold = var1;
              this.mHighThreshold = var2;
              this.mDurationLimit = var3;
              this.mLowThresholdTimeout = var4;
            } else {
              throw Exception("Illegal timeout value:$var4, should at least:10000");
            }
          } else {
            throw Exception("Illegal durationLimit value:${this.mDurationLimit}");
          }
        } else {
          throw Exception("Illegal highThreshold value:${this.mHighThreshold}");
        }
      } else {
        throw Exception("Illegal lowThreshold value:${this.mLowThreshold}");
      }
    }

    double getLowThreshold() {
      return this.mLowThreshold;
    }

    double getHighThreshold() {
      return this.mHighThreshold;
    }

    double getDurationLimit() {
      return this.mDurationLimit;
    }

    int getLowThresholdTimeout() {
      return this.mLowThresholdTimeout;
    }

    Map<String, dynamic> toJson() {
      return {
        "lowThreshold": mLowThreshold,
        "highThreshold": mHighThreshold,
        "durationLimit": mDurationLimit,
        "lowThresholdTimeout": mLowThresholdTimeout,
      };
    }
  }